
// 基于template/src/views/{{appModules}}/{{pages@DEMEDITVIEW9}}/{{spinalCase page.codeName}}-hook.ts.hbs生成
import { QXEvent } from 'qx-util';
import {
	MEditViewActionType,
	MEditViewController,
	IMEditViewAbility,
	IMEditViewControllerParams,
	IParam,
	IViewEvent,
} from '@/core';
import {
	useMEditViewProps,
	useMEditViewBasic,
	useMEditViewControllerParams,
    useMEditViewAction,
} from '@/hooks/view/use-medit-view';
import { model } from "./ibizbookm-edit-view-9-model";

/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useMEditViewProps()
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useMEditViewBasic(model, props)
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
        ...useMEditViewAction(controller)
    }
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<MEditViewActionType, IMEditViewAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<IViewEvent<MEditViewActionType, IMEditViewAbility>>
) {
	const params: IMEditViewControllerParams<
		MEditViewActionType,
		IMEditViewAbility
	> = useMEditViewControllerParams(model, props, evt);
	return new MEditViewController(params);
}